package com.gitee.socket.component;

import com.corundumstudio.socketio.SocketIOServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author : cc
 * @date : Create in 14:02 2018/10/31
 */

@Component
public class AdminSocketRunner implements CommandLineRunner {
    private final SocketIOServer server;

    @Autowired
    public AdminSocketRunner(SocketIOServer server) {
        this.server = server;
    }
    @Override
    public void run(String... args) throws Exception {
        server.start();
        System.out.println("socket.IO启动");
    }
}